<script setup lang="ts">
import * as echarts from 'echarts'
import { onMounted, ref, shallowRef } from 'vue'
// import Title from '../commont/Title.vue'
import { get_Menjin } from '../../request/index'
// import MyEearts from '../commont/MyEearts.vue'
const data = ref([])
let option = ref({})
const continer = shallowRef()
onMounted(() => {
  get_Menjin().then((res) => {
    // console.log(res)
    data.value = res.data.data.result[0].tableData
    var myChart = echarts.init(continer.value)
    option.value = res.data.data.result[0].option
    myChart.setOption(option.value)
    const onresize = () => {
      myChart.resize()
    }
    onresize()
    window.addEventListener('resize', onresize)
  })
})
</script>

<template>
     <div class="zuo" ref="continer"></div>
</template>

<style scoped lang="scss">
.zuo {
    width: 50%;
    height: 120px;
    // border: #fcc solid 1px;
}
</style>
